import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/user/info',
    method: 'post',
    params: {token}
  })
}

export function getList(data) {
  return request({
    url: '/user/list',
    method: 'post',
    data
  })
}

export function listSubAccounts(data) {
  return request({
    url: '/user/list-sub-accounts',
    method: 'post',
    data
  })
}

export function createUser(data) {
  return request({
    url: '/user/create',
    method: 'post',
    data
  })
}

export function updateUser(data) {
  return request({
    url: '/user/update',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/user/delete',
    method: 'post',
    data
  })
}


export function resetPwd(data) {
  return request({
    url: '/user/reset-pwd',
    method: 'post',
    data
  })
}

export function updateMchID(data) {
  return request({
    url: '/user/save-mch-id',
    method: 'post',
    data
  })
}

export function updateUserSmsSign(data) {
  return request({
    url: '/user/save-sms-sign',
    method: 'post',
    data
  })
}

export function checkUser(data) {
  return request({
    url: '/user/check',
    method: 'post',
    data
  })
}

export function meterColumns(data) {
  return request({
    url: '/user/columns',
    method: 'post',
    data
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}

export function childrenUsers(data) {
  return request({
    url: '/user/children',
    method: 'post',
    data
  })
}

export function saveShowOpenValve(data) {
  return request({
    url: '/user/save-show-open-valve',
    method: 'post',
    data
  })
}
